'use strict';

var conf = require('./conf'),
    connect = require('gulp-connect'),
    gulp = require('gulp'),
    runSequence = require('run-sequence');

gulp.task('node_modules', function() {
    runSequence('node_modules:fonts', 'node_modules:images', 'node_modules:styles');
});

gulp.task('node_modules:fonts', [], function() {
    return gulp.src([
            'node_modules/font-awesome/fonts/*.*'
        ])
        .pipe(gulp.dest(conf.paths.docs + '/fonts'))
        .pipe(connect.reload());
});

gulp.task('node_modules:images', function() {
    runSequence('node_modules:images_twemoji');
});

gulp.task('node_modules:images_twemoji', [], function() {
    return gulp.src([
            'node_modules/twemoji/2/svg/*.*'
        ])
        .pipe(gulp.dest(conf.paths.docs + '/img/twemoji'))
        .pipe(connect.reload());
});

gulp.task('node_modules:styles', function() {
    return gulp.src([
            'node_modules/font-awesome/css/font-awesome.min.css'
        ])
        .pipe(gulp.dest(conf.paths.docs + '/css'))
        .pipe(connect.reload());
});
